/*
 * BooleanConst.cpp
 *
 *  Created on: 17.04.2012
 *      Author: Eugene Kornykhin
 */

#include "BooleanConst.h"

BooleanConst::BooleanConst(bool value)
: value(value) {
}

BooleanConst::~BooleanConst() {

}

bool BooleanConst::isTrue() const {
	return value;
}

void BooleanConst::execute(Interpreter& interpreter) {
	interpreter.pushPolizElement(*this);
}

PolizPosition BooleanConst::next_position_after(PolizPosition p) const
{
	return p.next();
}


bool BooleanConst::isHalt() const {
	return false;
}

BooleanConst* BooleanConst::clone(const Poliz &) const {
	return new BooleanConst(value);
}

string BooleanConst::toString() const {
	return value?"[TRUE]" : "[FALSE]";
}
